package com.lyfei.ydc.domain.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lyfei.ydc.domain.BaseEntity;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;

@Getter
@Setter
@TableName("t_category")
public class Category extends BaseEntity<Category> {
    @NotEmpty(message = "分类名称不能为空")
    private String name;
    private String description;
    private Boolean isRoot;
    @NotNull(message = "上级分类不能为空")
    private Long parentId;
    private String img;
    @TableField(value = "`index`" )
    private Integer index;
    private Boolean online;
    // 是否删除
    @TableLogic
    private Boolean deleted;
    private Date createTime;
    private Date updateTime;
}
